--ARGV
-- Created by IntelliJ IDEA.
-- User: wangmaolin
-- Date: 2020/8/7
-- Time: 17:09
-- To change this template use File | Settings | File Templates.
--
local key1=ARGV[1]
local key2=ARGV[2]
local key3=ARGV[3]
local key4=ARGV[4]
local key5=ARGV[5]
local key6=ARGV[6]
local key7=ARGV[7]


local userId=ARGV[8]


local bitopKey='bitop and'
local sevenResultKey='seven:result';

local exist=redis.call('exists',sevenResultKey);
if exist ==1 then
    return redis.call('getbit',sevenResultKey,userId)
else
    redis.call(bitopKey,'seven:result',key1,key2,key3,key4,key5,key6,key7)
    return redis.call('getbit',sevenResultKey,userId)
end


